/**
 * @description 创建 action
 * @author fyj
 */

export const setData = (payload) => ({ type: 'setData', payload });

export const loadData = () => test;

function test (dispatch) {
  return new Promise((resolve, reject) => {
    // setTimeout(() => {
    //   const data = [{id: '1', title: 'xxxxx'}];
    //   resolve(dispatch(setData(data)));
    // }, 5000);
    const data = [{id: '1', title: 'xxxxx'}];
    resolve(dispatch(setData(data)));
  })
}

